package py.tres_mosqueteros.eventos.whatson;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;

import py.tres_mosqueteros.eventos.entidades.Evento;
import py.tres_mosqueteros.eventos.entidades.Util;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class FotosActivity extends ActionBarActivity {
	Evento evento;
	String idEvento;

	// View viewPerfil;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.fotos_layout);
		// overridePendingTransition(R.anim.slide_up_dialog, 0);
		final ActionBar actionBar = getSupportActionBar();
		actionBar.setDisplayHomeAsUpEnabled(true);

		// esto es para saber el eventoID
		// asi se le pasa las variables a los activities
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			idEvento = extras.getString("eventoId");

		}
		// aca se carga cada foto del FotoGrid
		GridView gridview = (GridView) findViewById(R.id.gridviewFotosLayout);
		Context mc = getBaseContext();

		gridview.setAdapter(new ImageAdapter3(mc,20));

		gridview.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> parent, View v,
					int position, long id) {
				Toast.makeText(getBaseContext(), "" + position,
						Toast.LENGTH_SHORT).show();
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
